package com.ruoyi.common.domainenum;



import com.baomidou.mybatisplus.annotation.EnumValue;
import com.ruoyi.common.enumsupport.IBaseEnum;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 */
public enum FinSubjectType implements IBaseEnum<String> {

    ZC("1", "资产"),
    FZ("2", "负债"),
    QY("3", "权益"),
    CB("4", "成本"),
    SY("5", "损益"),

    ;
    @EnumValue
    private final String value;
    private final String description;


    FinSubjectType(String value, String description) {
        this.value = value;
        this.description = description;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    @Override
    public String getDescription() {
        return description;
    }


    @Override
    public List<Map<String, String>> buildEnumMap() {
        List<Map<String, String>> result = new ArrayList<>();
        for (FinSubjectType valueType : FinSubjectType.values()) {
            Map<String, String> map = new HashMap<>();
            map.put("name", valueType.getDescription());
            map.put("code", valueType.toString());
            result.add(map);
        }
        return result;
    }

}
